import request from '@/utils/request'
export default {
  //添加
  add (data) {
    return request({
      url: '/firmwareService/device/add',
      method: 'POST',
      data
    })
  },
  //修改
  edit (data) {
    return request({
      url: '/firmwareService/device/edit',
      method: 'POST',
      data
    })
  },
  //列表查询
  queryList (params) {
    return request({
      url: '/firmwareService/device/queryList',
      method: 'get',
      params
    })
  },
  //分页查询
  queryPageList (params) {
    return request({
      url: '/firmwareService/device/queryPageList',
      method: 'get',
      params
    })
  },
  //主键删除接口
  del (id) {
    return request({
      url: '/firmwareService/device/del',
      method: 'post',
      data: {
        deviceId: id
      }
    })
  },
  //主键批量删除接口
  delList (idList) {
    return request({
      url: '/firmwareService/device/delList',
      method: 'post',
      data: {
        deviceIdList: idList
      }
    })
  },
  //上报坐标
  reportCoordinate(data){
    return request({
      url: '/firmwareService/device/reportCoordinate',
      method: 'post',
      data
    })
  },
  //更新设备参数
  updateDataItem(data){
    return request({
      url: '/firmwareService/deviceDataItem/updateDataItem',
      method: 'post',
      data
    })
  },
  getFilesByDeviceCode (deviceCode) {
    return request({
      url: '/firmwareService/device/getFilesByDeviceCode',
      method: 'get',
      params:{ deviceCode}
    })
  },
}